import { Grade } from '/@/types/Grade'

export type IForm = {
  id?: string
  appointmentPublishCode?: string
  // grade: null | Grade
  reserveDate: string
  reserveStartTime: string
  reserveEndTime: string
  maxNum: number
  description: string
  deadline: string
  status: Status
  remainder?: string | number
}

export class ReserveForm implements IForm {
  // grade = null
  reserveDate = ''
  reserveStartTime = ''
  reserveEndTime = ''
  maxNum = 5
  description = ''
  deadline = ''
  status = Status.draft
  // remainder = 0
}

export type ReserveParams = {
  id?: string
  appointmentPublishCode?: string
  // gradeIds: string | undefined
  deadline: string
  startTime: string
  endTime: string
  maxNum: number
  description?: string
  status?: Status
  remainder?: string | number
}

export enum Status {
  /**
   * 草稿
   */
  draft = 0,

  /**
   * 已发布可预约
   */
  released = 1,

  /**
   * 预约人数已满
   */
  overFull = 2,

  /**
   * 已截止预约
   */
  deadlined = 3,

  /**
   * 已结束
   */
  cloased = 4,
}

export interface Reserve {
  sort: number
  createBy: string
  createAt: string
  updateBy: string
  updateAt: string
  isDeleted: number
  id: string
  tenantId: string
  userId: string
  appointmentPublishCode: string
  // gradeIds: string
  deadline: string
  startTime: string
  endTime: string
  maxNum: number
  remainder: number
  description: string
  publishTime: string
  status: number
}

export interface ServiceForm {
  content: string
  complaint: string
  nextTime: string
  [key: string]: string
}

export interface UserForm {
  assist: number
  satisfied: number
  grasp: number
  opinion: string
  advisoryRecordsId: any
  [key: string]: number | string
}
